
//
//  YJStatusBottomView.swift
//  YJWeiBo
//
//  Created by Jim1024 on 2017/1/18.
//  Copyright © 2017年 Jim1024. All rights reserved.
//

import UIKit

class YJStatusBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initCustomView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate func initCustomView() {
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(separatorViewFirst)
        addSubview(separatorViewSeconde)
        
        /*================= layout =================*/
        
        forwardButton.snp.makeConstraints { (make) in
            make.top.leading.bottom.equalToSuperview()
        }
        
        commentButton.snp.makeConstraints { (make) in
            make.top.bottom.equalTo(forwardButton)
            make.leading.equalTo(forwardButton.snp.trailing)
            make.width.equalTo(forwardButton)
        }
        
        likeButton.snp.makeConstraints { (make) in
            make.top.bottom.equalTo(forwardButton)
            make.leading.equalTo(commentButton.snp.trailing)
            make.trailing.equalToSuperview()
            make.width.equalTo(forwardButton)
        }
        
        separatorViewFirst.snp.makeConstraints { (make) in
            make.centerX.equalTo(forwardButton.snp.trailing)
            make.centerY.equalTo(forwardButton)
        }
        
        separatorViewSeconde.snp.makeConstraints { (make) in
            make.centerX.equalTo(commentButton.snp.trailing)
            make.centerY.equalTo(separatorViewFirst)
        }
    }
    
    // MARK: - 懒加载
    
    /// 转发
    fileprivate lazy var forwardButton: UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet")
    
    /// 评论
    fileprivate lazy var commentButton: UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment")
    
    /// 赞
    fileprivate lazy var likeButton: UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike")
    
    /// 分割线1
    fileprivate lazy var separatorViewFirst: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    /// 分割线2
    fileprivate lazy var separatorViewSeconde: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))

}
